<?php
/**
 * Created by PhpStorm.
 * User: xuke
 * Date: 16/6/7
 * Time: 下午4:41
 */

namespace App\Exceptions;
use ApiResultFacade;

class AdminException extends  Base
{

    /**
     * 错误码类别:-1系统错误,-2数据库错误,-3请求错误,1参数错误,2权限错误
     */
    public static function report($e, $request)
    {
//        $apiResult = app('ApiResult');
//        dd($apiResult);
//        echo 88;
//        $apiResult->setStatus($e->getCode())->setMsg($e->getMessage())->ApiResult();
        if($request->ajax())
        {
            return ApiResultFacade::setStatus($e->getCode())->setMsg($e->getMessage())->ApiResult();
        }else{
//            abort(403, 'Unauthorized action.');
        }


    }
}